home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
61266
/
61266.xpi
/
chrome
/
content
/
.ff-overlay.js.swo
(
.txt
)
next >
Wrap
Vim Swap
|
2010-02-08
|
37KB
|
462 lines
b0VIM 7.2
zheneva
zheneva-desktop
~zheneva/.mozilla/firefox/kbmc7pkb.dev/extensions/Xsticky-StickyNotes@xsticky.com/chrome/content/ff-overlay.js
utf-8
3210#"!
window.window.addEventListener("click", com.chechurin.beststickynotwindow.addwindow.addEventListener("click", com.chwindow.addwwwindow.addEventListener("click"wwindow.awwwindow.addEventListener("click", com.chechurin.beststickynotes.onClick, false);
window.addEventListener("load", com.chechurin.beststickynotes.onFirefoxLoad, false);
return pub;
};
}
YpageYOffset = e.pageY;
YpageXOffset = e.pageX;
{
if (e.button == 2 && e.target.id !="beststickynotes-statusbar")
e = e || window.event;
// checked if clicked right mouse button
pub.onClick = function(e) {
};
}
var newStickyNote = new StickyNote((bod.clientWidth-MIN_WIDTH)/2, ((window.innerHeight)/3+doc.defaultView.scrollY));
var bod = doc.getElementsByTagName('body')[0];
var doc = doc || window.content.document;
{
else if (e.target.id =="beststickynotes-statusbar")
}
var newStickyNote = new StickyNote();
{
if (e.target.id =="context-beststickynotes")
e = e || window.event;
// checked if clicked right mouse button
pub.addStickyNote = function(e){
};
document.getElementById("context-beststickynotes").hidden = gContextMenu.onImage;
// show or hide the menuitem based on what the context menu is on
pub.showFirefoxContextMenu = function(event) {
};
}
}
new StickyNote(stickyNotesColl.x[i], stickyNotesColl.y[i], stickyNotesColl.width[i], stickyNotesColl.height[i], stickyNotesColl.text[i],doc);
{
if (stickyNotesColl.links[i]==doc.location.href)
for (i in stickyNotesColl.links){
var doc = aEvent.originalTarget; // doc is document that triggered "onload" event
pub.onPageLoad = function(aEvent) {
};
appcontent.addEventListener("DOMContentLoaded", pub.onPageLoad, true);
if(appcontent)
var appcontent = document.getElementById("appcontent"); // browser
.addEventListener("popupshowing", function (e){ pub.showFirefoxContextMenu(e); }, false);
document.getElementById("contentAreaContextMenu")
stickyNotesColl = JSON.parse(stickyNotes);
stickyNotes = prefs.getCharPref("stickyNotes");
// Gets JSON sticky notes collection
}
prefs.setIntPref("folderId", newFolderId);
var newFolderId = bmsvc.createFolder(menuFolder, "Sticky Notes", bmsvc.DEFAULT_INDEX);
{
catch(e)
}
bmsvc.getItemType(folderId);
{
try
MIN_HEIGHT = prefs.getIntPref("fontsize")*1.75;
var folderId = prefs.getIntPref("folderId");
var menuFolder = bmsvc.bookmarksMenuFolder; // Bookmarks menu folder
.getService(Components.interfaces.nsINavBookmarksService);
var bmsvc = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]
// checks existing of bookmarks folder, and creates:
pub.onFirefoxLoad = function(event) {
// Also checked if Bookmarks folder created, and if not - creates
// On Fx load gets stickyNotes, parses JSON and added event listeners.
var pub = {};
var stickyNotesColl;
var stickyNotes = '';
}
prefs.setCharPref("stickyNotes", JSON.stringify(stickyNotesColl));
function savePreferences(){
a.className = "eche-best-sticky-note-top-close";
removeImg.src = "chrome://beststickynotes/skin/xsticky/close1.jpg";
var removeImg = doc.createElement("img");
}, true);
}
removeStickyNote(stickyNote);
stickyNote.remove();
{
if (window.confirm("Current Note will be completely removed. Continue?"))
a.addEventListener("click", function() {
// Remove button click listener
stickyNote.container.parentNode.removeChild(stickyNote.container);
stickyNote.remove = function() {
// Remove Method
var a = doc.createElement("a");
// Remove Sticky note button
div.appendChild(topTitle);
topTitle.appendChild(doc.createTextNode("Xsticky-Tool"));
var topTitle = doc.createElement("span");
div.style.MozUserSelect="none";
div.className = "eche-best-sticky-note-top";
v alert(stickyNote.conta stickyNote.con stickyNo stickyNote.container.className = "eche-best-sticky-note";
});
zIndex: BASE_Z_INDEX
width: stickyNote._width + "px",
top: stickyNote._y + "px",
left: stickyNote._x + "px",
position: "absolute",
ECHE.css([stickyNote.container],{
stickyNote._height = height == undefined || height < MIN_HEIGHT ? MIN_HEIGHT : height;
stickyNote._width = width == undefined || width < MIN_WIDTH ? MIN_WIDTH: width;
stickyNote._y = y == undefined ? YpageYOffset : y;
stickyNote._x = x == undefined ? YpageXOffset : x;
stickyNote.container = doc.createElement("div");
stickyNote._state = STATE_DISPLAY;
stickyNote._moveY = 0;
stickyNote._moveX = 0;
var stickyNote = this;
var bod = doc.getElementsByTagName('body')[0];
doc = doc || window.content.document;
var StickyNote = function(x, y, width, height, text, doc){
// Sticky Notes class
var YpageXOffset, YpageYOffset;
var MIN_HEIGHT;
var MIN_WIDTH = 200;
// Min widh/height
var STATE_RESIZE = 3;
var STATE_MOVE = 2;
var STATE_EDIT = 1;
var STATE_DISPLAY = 0;
var BASE_Z_INDEX = 100000;
sss.loadAndRegisterSheet(uri, sss.USER_SHEET);
if(!sss.sheetRegistered(uri, sss.USER_SHEET))
var uri = ios.newURI("chrome://beststickynotes/skin/overlay.css", null, null);
.getService(Components.interfaces.nsIIOService);
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIStyleSheetService);
var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"]
// Load sticky notes CSS to global stylessheets
var ECHE = com.chechurin.utils;
com.chechurin.beststickynotes = function(){
}
}
com.chechurin.utils.setStyle(el, prop, styles[prop]);
if (!styles.hasOwnProperty(prop)) continue;
for (var prop in styles){
css: function(el, styles){
// })
// width: '100px'
// position: 'absolute',
// css([foo, bar],{
// Usage:
// Add css styles to element or array elements
},
}
elements[i].style[prop] = value;
for (var i = 0, len = elements.length-1; i <= len; ++i) {
setStyle: function(elements, prop, value){
// setStyle([div, someSpan], 'position', 'absolute')
// Usage:
// Set specific style to element or array of elements
com.chechurin.utils = {
// Helper functions
if(!com.chechurin) com.chechurin={};
if(!com) var com={};
a.className = "eche-best-sticky-note-top-close";
removeImg.src = "chrome://beststickynotes/skin/xsticky/close1.jpg";
var removeImg = doc.createElement("img");
}, true);
}
removeStickyNote(stickyNote);
stickyNote.remove();
{
if (window.confirm("Current Note will be completely removed. Continue?"))
a.addEventListener("click", function() {
// Remove button click listener
stickyNote.container.parentNode.removeChild(stickyNote.container);
stickyNote.remove = function() {
// Remove Method
var a = doc.createElement("a");
// Remove Sticky note button
div.appendChild(topTitle);
topTitle.appendChild(doc.createTextNode("Xsticky-Tool"));
var topTitle = doc.createElement("span");
div.style.MozUserSelect="none";
div.className = "eche-best-sticky-note-top";
var div = doc.createElement("div");
stickyNote.setText = function(text) {
// Setting Sticky Note text
stickyNote._height = height;
stickyNote.editText.style.height = stickyNote.displayText.style.height = height + "px";
stickyNote.setHeight = function(height) {
stickyNote._width = width;
stickyNote.container.style.width = width + "px";
stickyNote.setWidth = function(width) {
stickyNote.container.style.top = y + "px";
stickyNote._y = y;
stickyNote.setY = function(y) {
stickyNote.container.style.left = x + "px";
stickyNote._x = x;
stickyNote.setX = function(x) {
return stickyNote._height;
stickyNote.getHeight = function() {
return stickyNote._width;
stickyNote.getWidth = function() {
return stickyNote._y;
stickyNote.getY = function() {
return stickyNote._x;
stickyNote.getX = function() {
stickyNote.editText.addEventListener("blur", endEdit, true);
}, true);
endEdit();
if (e.which == 27) {
stickyNote.editText.addEventListener("keyup", function(e) {
saveStickyNotes(stickyNote);
stickyNote.displayText.innerHTML = stickyNote.editText.value.replace(/\n/g,"<br/>");
stickyNote._state = STATE_DISPLAY;
stickyNote.editText.style.display="none";
stickyNote.displayText.style.display="block";
stickyNote.displayText.style.opacity = prefs.getCharPref("transparency");
function endEdit() {
// End of editing Sticky Note
}, true);
stickyNote.editText.focus();
stickyNote._state = STATE_EDIT;
stickyNote.editText.style.display="block";
stickyNote.displayText.style.display="none";
// stickyNote.displayText.style.opacity = "1";
stickyNote.container.addEventListener("dblclick", function() {
// Dbclick on Sticky Note listener
}, true);
return true;
return false;
stickyNote.editText.style.height = stickyNote.displayText.style.height = stickyNote._height + "px";
stickyNote._moveY = e.pageY;
stickyNote._height = newHeight;
if (newHeight >= MIN_HEIGHT) {
stickyNote.container.style.width = stickyNote._width + "px";
stickyNote._moveX = e.pageX;
stickyNote._width = newWidth;
if (newWidth >= MIN_WIDTH) {
var newHeight = stickyNote._height + e.pageY - stickyNote._moveY;
var newWidth = stickyNote._width + e.pageX - stickyNote._moveX;
case STATE_RESIZE:
return false;
stickyNote._moveY = e.pageY;
stickyNote._moveX = e.pageX;
stickyNote.container.style.top = stickyNote._y + "px";
stickyNote.container.style.left = stickyNote._x + "px";
stickyNote._y += e.pageY - stickyNote._moveY;
stickyNote._x += e.pageX - stickyNote._moveX;
case STATE_MOVE:
switch (stickyNote._state) {
window.addEventListener("mousemove", function(e) {
}, true);
saveStickyNotes(stickyNote);
stickyNote._state = STATE_DISPLAY;
div.style.cursor = "default";
bod.style.MozUserSelect="text";
if (e.button == 0 && (stickyNote._state == STATE_MOVE || stickyNote._state == STATE_RESIZE)) {
window.addEventListener("mouseup", function(e) {
}, true);
return true;
return false;
div.style.cursor = "move";
stickyNote.eventHelper(e, STATE_MOVE);
if (e.button == 0 && stickyNote._state == STATE_DISPLAY) {
div.addEventListener("mousedown", function(e) {
// Mouse up, down, move event listeners
}, true);
return true;
return false;
stickyNote.eventHelper(e, STATE_RESIZE);
prefs = prefs.getBranch("extensions.beststickynotes.");
.getService(Components.interfaces.nsIPrefService);
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
}
savePreferences();
stickyNotesColl.text = [text for each (text in stickyNotesColl.text) if (text != stickyNote.getText())];
stickyNotesColl.height = [height for each (height in stickyNotesColl.height) if (height != stickyNote.getHeight())];
stickyNotesColl.width = [width for each (width in stickyNotesColl.width) if (width != stickyNote.getWidth())];
stickyNotesColl.y = [y for each (y in stickyNotesColl.y) if (y != stickyNote.getY())];
stickyNotesColl.x = [x for each (x in stickyNotesColl.x) if (x != stickyNote.getX())];
stickyNotesColl.links = [note for each (note in stickyNotesColl.links) if (note != uri)];
var uri = doc.location.href;
var doc = window.content.document;
function removeStickyNote(stickyNote) {
}
savePreferences();
}
}
}
bmsvc.insertBookmark(prefs.getIntPref("folderId"), uri, bmsvc.DEFAULT_INDEX, bTitle);
if (!bmsvc.isBookmarked(uri)) {
uri = ios.newURI(uri, null, null);
.getService(Components.interfaces.nsINavBookmarksService);
var bmsvc = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]
// Creating new bookmark for Sticky Note
pushToColl = false;
stickyNotesColl.height.push(stickyNote.getHeight());
stickyNotesColl.width.push(stickyNote.getWidth());
stickyNotesColl.y.push(stickyNote.getY());
stickyNotesColl.x.push(stickyNote.getX());
stickyNotesColl.text.push(stickyNote.getText());
stickyNotesColl.links.push(uri);
if(pushToColl){
}
pushToColl = false;
stickyNotesColl.height[i]=stickyNote.getHeight();
stickyNotesColl.width[i]=stickyNote.getWidth();
stickyNotesColl.y[i]=stickyNote.getY();
stickyNotesColl.x[i]=stickyNote.getX();
stickyNotesColl.text[i]=stickyNote.getText();
stickyNotesColl.links[i] == uri;
if ( stickyNotesColl.links[i] == uri ) {
for (var i = 0; i < stickyNotesColl.links.length; i++ ) {
var pushToColl = true;
var bTitle = doc.title;
var uri = doc.location.href;
var doc = window.content.document;
if (stickyNotesColl.links.length != 0) {
function saveStickyNotes(stickyNote) {
};
bod.appendChild(stickyNote.container);
resizeGrabber.style.MozUserSelect="none";
stickyNote.displayText.style.MozUserSelect = "none";
stickyNote.setText(text);
if (text != undefined) {
}
this._moveY = e.pageY;
this._moveX = e.pageX;
this._state = STATE;
bod.style.MozUserSelect="none";
stickyNote.eventHelper = function(e, STATE){
// Events helper function
return stickyNote.editText.value;
stickyNote.getText = function() {
// Getting Sticky Note text
stickyNote.editText.value = text;
stickyNote.displayText.innerHTML = text.replace(/\n/g,"<br/>");
if (e.button == 0 && stickyNote._state != STATE_EDIT) {
resizeGrabber.addEventListener("mousedown", function(e) {
// Resize grabber event listener
stickyNote.container.appendChild(divBottom);
stickyNote.container.appendChild(stickyNote.editText);
stickyNote.container.appendChild(stickyNote.displayText);
divBottom.appendChild(home);
home.appendChild(homeImg);
homeImg.src = "chrome://beststickynotes/skin/xsticky/home1.jpg";
var homeImg = doc.createElement("img");
}, true);
gBrowser.selectedTab = gBrowser.addTab("http://xsticky.com/");
event.preventDefault();
event.stopPropagation();
home.addEventListener("click", function(event) {
// Home button click listener
home.href = "http://xsticky.com/";
var home = doc.createElement("a");
divBottom.style.MozUserSelect="none";
divBottom.className = "eche-best-sticky-note-bottom";
var divBottom = doc.createElement("div");
// Bottom div constructor
});
opacity: prefs.getCharPref("transparency")
ECHE.css([stickyNote.displayText],{
});
margin: "0px",
border: "none",
display: "none",
ECHE.css([stickyNote.editText],{
lineHeight: prefs.getIntPref("fontsize")*2 + "px",
fontSize: prefs.getIntPref("fontsize") + "pt",
fontFamily: prefs.getCharPref("font"),
ECHE.css([stickyNote.displayText,stickyNote.editText],{
stickyNote.editText.className = "eche-best-sticky-note-edit-text";
stickyNote.editText = doc.createElement("textarea");
stickyNote.displayText.className = "eche-best-sticky-note-display-text";
stickyNote.displayText.title = "double click to edit sticky note";
stickyNote.displayText = doc.createElement("div");
stickyNote.container.appendChild(resizeGrabber);
resizeGrabber.className = "eche-best-sticky-note-resize-grabber";
var resizeGrabber = doc.createElement("div");
stickyNote.container.appendChild(div);
// Append Sticky body to container
div.appendChild(settings);
settings.appendChild(setImg);
settings.title="Current sticky note properties";
settings.className = "eche-best-sticky-note-top-close";
setImg.src = "chrome://beststickynotes/skin/xsticky/properties1.jpg";
var setImg = doc.createElement("img");
}, true);
alert("Current Note properties still in development, wait for update.");
settings.addEventListener("click", function() {
// Settings button click listener
var settings = doc.createElement("a");
// Settings Sticky note button
div.appendChild(min);
min.appendChild(minImg);
min.title="Minimize this sticky note";
min.className = "eche-best-sticky-note-top-close";
minImg.src = "chrome://beststickynotes/skin/xsticky/minimize1.jpg";
var minImg = doc.createElement("img");
}, true);
minImg.src = minImg.src == "chrome://beststickynotes/skin/xsticky/minimize1.jpg" ? "chrome://beststickynotes/skin/xsticky/maximize1.jpg" : "chrome://beststickynotes/skin/xsticky/minimize1.jpg";
stickyNote.displayText.style.display = stickyNote.displayText.style.display == "none" ? "block" : "none";
min.addEventListener("click", function() {
// Minimize button click listener
var min = doc.createElement("a");
// Minimize Sticky note button
div.appendChild(a);
a.appendChild(removeImg);
a.title="Remove this sticky note";
if (e.button == 0 && stickyNote._state != STATE_EDIT) {
resizeGrabber.addEventListener("mousedown", function(e) {
// Resize grabber event listener
stickyNote.container.appendChild(divBottom);
stickyNote.container.appendChild(stickyNote.editText);
stickyNote.container.appendChild(stickyNote.displayText);
divBottom.appendChild(home);
home.appendChild(homeImg);
homeImg.src = "chrome://beststickynotes/skin/xsticky/home1.jpg";
var homeImg = doc.createElement("img");
}, true);
gBrowser.selectedTab = gBrowser.addTab("http://xsticky.com/");
event.preventDefault();
event.stopPropagation();
home.addEventListener("click", function(event) {
// Home button click listener
home.href = "http://xsticky.com/";
var home = doc.createElement("a");
divBottom.style.MozUserSelect="none";
divBottom.className = "eche-best-sticky-note-bottom";
var divBottom = doc.createElement("div");
// Bottom div constructor
});
opacity: prefs.getCharPref("transparency")
ECHE.css([stickyNote.displayText],{
});
margin: "0px",
border: "none",
display: "none",
ECHE.css([stickyNote.editText],{
});
height: stickyNote._height + "px"